Accept a type of TARGETS instead of ATOM, too. Based on a patch by Peng
authorMatthias Clasen <matthiasc@src.gnome.org>
Mon, 19 Jan 2009 05:15:57 +0000 (05:15 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 19 Jan 2009 05:15:57 +0000 (05:15 +0000)
        * gtk/gtkselection.c (gtk_selection_data_get_targets): Accept
        a type of TARGETS instead of ATOM, too. Based on a patch by
        Peng Wu.

svn path=/trunk/; revision=22141

ChangeLog
gtk/gtkselection.c

index a74f6816481ad95e112abd901a1dfc26d4d794e7..e56dd8911bf8598b9cc00f5d964132a0e98416bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-01-18  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 568263 – gtk can't recognize the wrong X Selection TARGETS' 
+       type "TARGETS" by java applications
+
+       * gtk/gtkselection.c (gtk_selection_data_get_targets): Accept
+       a type of TARGETS instead of ATOM, too. Based on a patch by 
+       Peng Wu. 
+
 2009-01-18  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 568233 – Wrong statement about GtkEntry's "activate" signal
index f1ee12a9052ed33b49ca9d6df2b158c7391bade3..8bc3ca9f20e41929d80beae1f97c5dac9b9c1d2c 100644 (file)
@@ -1814,9 +1814,12 @@ gtk_selection_data_get_targets (GtkSelectionData  *selection_data,
 {
   g_return_val_if_fail (selection_data != NULL, FALSE);
 
+  /* As usual, java gets it wrong and sets the type to TARGETS, not ATOM 
+   */
   if (selection_data->length >= 0 &&
       selection_data->format == 32 &&
-      selection_data->type == GDK_SELECTION_TYPE_ATOM)
+      (selection_data->type == GDK_SELECTION_TYPE_ATOM ||
+       selection_data->type == gtk_selection_atoms[TARGETS]))
     {
       if (targets)
        *targets = g_memdup (selection_data->data, selection_data->length);